package com.atguigu.eduservice.mapper;

import com.atguigu.eduservice.entity.ConfigItemBase;
import com.atguigu.eduservice.entity.RealLandBase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RealLandBaseMapper {

    void insertBatch(List<RealLandBase> list);

    @Select({"SELECT b.ItemId,b.ParentId,b.ItemCode,b.ItemName,b.Category,b.Remark,b.SonCount,b.UpdateTime,b.active_flag FROM config_item_base b,config_category_base c WHERE b.Category = c.CategoryCode and c.CategoryName = #{categoryName}"})

    List<ConfigItemBase> getConfigInfoByCategoryName(String categoryNames);


    @Select({"select ItemCode from config_item_base where ItemName = #{itemname} limit 1"})
    String getItemCode (@Param("itemname") String itemname);


    @Select({" select organization_id\n" +
            "        from system_organization_base\n" +
            "        where 1=1\n" +
            "        and organization_name = #{organizationName } limit 1"})
    String organizationName(@Param("organizationName") String organizationName);




}
